#!/user/bin/python
# -*- coding: utf-8 -*-
'''
 @Time    : 2018/5/16 22:14
 @File    : server_namespace_base.py
 @desc    :
'''
from flask import current_app
from flask_socketio import Namespace


class ServerBaseNamespace(Namespace):
    '''
    基础类
    扩展调用方式 self.extend_context.service（key为service的环境扩展）
    '''

    SOCKETIO_KEY = 'socketio'

    KEY = '/base'

    def __init__(self, namespace=None):
        super(ServerBaseNamespace, self).__init__(namespace)
        self.extend_context = current_app

